#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from my_abs import my_abs
from functools import reduce
#print("hello world!");
#print(10+20);
#print("你好！","我这叫做的什么事啊！")
#name=input("please enter your name:");
#print("你好呀",name);
# print(not 3>5);
# print(10//3);
# print("你好,喵喵","欢迎到来！") ;
# list1=["小周","小猪","小牛"];
# print(len(list1));
# list1.insert(1,"小狗狗");
# list1.append("阿牛");
# print(len(list1));
# print(list1[4]);
# list1.pop();
# print(len(list1));
# list1.pop(2);
# print(list1[2]);
# list1[1]="十二";
# list1.append([123,456,"abc"]);
# print(list1);
# print(len(list1));
# print(list1[3][1]);
# tuple1=(1,2,3,4,5,6,7,8,9,0);
# print(tuple1);
# print(tuple1[7]);
# ages=input("please enter your age:");
# age=int(ages);
# if age>18:
#     print("你已经成年了");
# elif age==18: print("你今年刚成年！");
# else :print("你还是个未成年人");
# heights=input("please enter your height:");
# weights=input("please enter your weight:");
# heigth=float(heights);
# weight=float(weights);
# BMI=weight/(heigth*heigth);
# if BMI<=18.5:print("您的体重过轻喔！")
# elif 18.5<BMI<=25:print("您的体重正常！");
# else:print("您太胖啦！")
# list=["小周","小牛","小猪","小狗"];
# for li in list:
#     print(li);
# sum=0;
# for x in[1,2,3,4,5,6,7,8,9,10]:
#     sum=sum+x;
# print(sum);
#
# s=0;
# for x in range(101):
#     s=s+x;
# print(s);
#
# su=0;
# n=100;
# while n>0:
#     su=su+n;
#     n=n-1;
# print(su);
# dict={"小周":80,"小狗":90,"小牛":100,"小猪":60};
# print(dict["小猪"]);
# dict["小猪"]=78;
# print(dict["小猪"]);
# print(dict.get("小虫"));
# dict.pop("小狗");
# print(dict.get("小狗"));
# print(abs(-102));
# print(max(1,3,24,22,3,23,67,33));
# print(my_abs(99));
# def power(x,n=2):
#     s=1;
#     while n>0:
#         n=n-1;
#         s=s*x;
#     return s;
# print(power(5,6));
# def errol(name,city,age=6,sex="女"):
#     print("name:",name);
#     print("city:",city);
#     print("age:",age);
#     print("sex:",sex);
#
# print(errol("小周","上海",sex="男"));
# def cal(*numbers):
#     sum=0;
#     for x in numbers:
#         sum=sum+x*x;
#     return sum;
# print(cal(*[1,2,3,4,5,6]));
# print(cal(1,2,3,4,5,6))

# def fact(n,p):
#     if n==1:
#         return p;
#     else:
#         return fact(n-1,p*n);
#
# def f(n):
#     return fact(n,1);
#
# print(f(100));
# list2=["小猪","小牛","小狗","小周","小高","小刘"];
# print(list2[0:3]);
# print(list2[-2:]);
# print(list2[::2])
# str="swhdgewkjewhdijehqdufuheuqhufhewqufewqlfhewhfqiuehfue";
# print(str[-1]);
# def tram(s):
#     while s[0]==" ":
#           s=s[1:];
#     while (s[-1]) == " ":
#           s=s[:-1];
#     return s;
# print("开始"+tram("     wqfewfrewref         ")+"结束");
# dic={"a":1,"b":2,"c":3,"d":4};
# for key in dic:
#     print(key);
# for v in dic.values():
#     print(v);
# for d in dic.items():
#     print(d);
# def findMinMax(li=[]):
#     mi=li[0];
#     ma=li[0];
#     for x in li:
#         if x<mi:
#             mi=x;
#         if x>ma:
#             ma=x;
#     return mi,ma;
# l=[1,2,3,4,5,65,4,33,45,6,75,12,456,35,99,5,233,-22,-34,222,-9];
# print("最大值："+str(findMinMax(l)[1]));
# print("最小值："+str(findMinMax(l)[0]));
# print(list(range(1,11)));
# li=[];
# for x in range(1,11):
#     if x%2==0:
#         li.append(x*x);
# print(li);
# l=[x * x for x in range(1, 11) if x % 2 == 0];
# print(l);
# ll=[m+n for m in "abc" for n in "xyz"];
# print(ll);

# d={"A":1,"B":2,"C":3,"D":4};
# L=[K+"对应"+str(V) for K,V in d.items()];
# print(L);
# g=(x * x for x in range(1, 11) if x % 2 == 0);
# print(g);
# print(next(g));
# for n in g:
#     print(n);
# def fib(max):
#     n, a, b = 0, 0, 1
#     while n < max:
#         print(b)
#         a, b = b, a + b
#         n = n + 1
#     return 'done'
# fib(6);
def f(x):
    return x*x;
r=map(f,[1,2,3,4,5,6,7,8,9]);
print(list(r));
s=list(map(str,[1,2,3,4,5,6,7,8,9]));
print(s);

def add(x,y):
    return x*10+y;
s=reduce(add,[1,2,3,2,4,5]);
print(s);